<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

use \Illuminate\Routing\Router;
use App\Http\Controllers\Guard\Login\LoginController;
use App\Http\Controllers\Guard\Rbac\PermissionController;
use App\Http\Controllers\Guard\Rbac\GuardUserController;
use App\Http\Controllers\Guard\Rbac\RoleController;
use App\Http\Controllers\Guard\Index\IndexController;
use App\Http\Controllers\Guard\Setting\SysSettingController;
use App\Http\Controllers\Guard\Article\ArticleClassifyController;
use App\Http\Controllers\Guard\Article\ArticleInfoController;
use App\Http\Controllers\Guard\Advert\AdvertController;
use App\Http\Controllers\Guard\User\UserController;
use App\Http\Controllers\Guard\Repair\RepairFactoryController;
use App\Http\Controllers\Guard\User\ChengBaoController;
use App\Http\Controllers\Guard\User\LiPeiController;
use App\Http\Controllers\Guard\Order\OrderController;


/****************************************** guard ************************************************/

//登录
Route::match(['get','post'],'/login',[LoginController::class,'login']);
Route::get('/logout',[LoginController::class,'logout']);
Route::get('/changeCol',[LoginController::class,'changeCol']);
Route::post('/upload',[LoginController::class,'upload']);
Route::get('/getVerifyCodeImg',[LoginController::class,'getVerifyCodeImg']);
Route::get('/getArea',[LoginController::class,'getArea']);
Route::get('/download',[LoginController::class,'download']);
//rbac权限管理
Route::group(['prefix'=>'rbac','middleware'=>'guard'],function(Router $router){

    $router->get('/getGuardUser',[IndexController::class,'getGuardUser']);
    $router->get('/loginLog',[IndexController::class,'loginLog']);

    $router->match(['get','post'],'/permission/lst',[PermissionController::class,'lst']);
    $router->match(['get','post'],'/permission/add',[PermissionController::class,'add']);
    $router->get('/permission/getPermission',[PermissionController::class,'getRecord']);
    $router->get('/permission/del',[PermissionController::class,'del']);

    $router->get('/role/lst',[RoleController::class,'lst']);
    $router->match(['get','post'],'/role/add',[RoleController::class,'add']);
    $router->get('/role/del',[RoleController::class,'del']);
    $router->get('/role/getRole',[RoleController::class,'getRecord']);

    $router->get('/guardUser/getPermission',[GuardUserController::class,'getPermission']);
    $router->get('/guardUser/lst',[GuardUserController::class,'lst']);
    $router->match(['get','post'],'/guardUser/add',[GuardUserController::class,'add']);
    $router->get('/guardUser/getUser',[GuardUserController::class,'getRecord']);
    $router->get('/guardUser/getUserByToken',[GuardUserController::class,'getUserByToken']);
    $router->get('/guardUser/del',[GuardUserController::class,'del']);
    $router->post('/guardUser/edit',[GuardUserController::class,'edit']);
    $router->post('/guardUser/resetPassword',[GuardUserController::class,'resetPassword']);
    $router->post('/guardUser/coverPassword',[GuardUserController::class,'coverPassword']);


});

//系统设置
Route::group(['prefix'=>'setting'],function(Router $router){

    $router->match(['get','post'],'/sys/index',[SysSettingController::class,'index']);

});

//广告管理
Route::group(['prefix'=>'advert'],function(Router $router){
    $router->get('/lst',[AdvertController::class,'lst']);
    $router->get('/del',[AdvertController::class,'del']);
    $router->get('/getAdvert',[AdvertController::class,'getRecord']);
    $router->match(['get','post'],'/add',[AdvertController::class,'add']);
});

//文章管理
Route::group(['prefix'=>'article'],function(Router $router){

    //分类
    $router->get('/classify/lst',[ArticleClassifyController::class,'lst']);
    $router->get('/classify/detail',[ArticleClassifyController::class,'getRecord']);
    $router->get('/classify/del',[ArticleClassifyController::class,'del']);
    $router->match(['get','post'],'/classify/add',[ArticleClassifyController::class,'add']);

    //列表
    $router->any('/uploadImg',[ArticleInfoController::class,'uploadImg']);
    $router->any('/uploadVideo',[ArticleInfoController::class,'uploadVideo']);
    $router->get('/lst',[ArticleInfoController::class,'lst']);
    $router->get('/detail',[ArticleInfoController::class,'getRecord']);
    $router->get('/del',[ArticleInfoController::class,'del']);
    $router->match(['get','post'],'/add',[ArticleInfoController::class,'add']);

});

//用户管理
Route::group(['prefix'=>'user'],function(Router $router){

    $router->get('/lst',[UserController::class,'lst']);
    $router->get('/detail',[UserController::class,'detail']);
    $router->get('/del',[UserController::class,'del']);
    $router->match(['get','post'],'/add',[UserController::class,'add']);
    $router->match(['get','post'],'/uploadUser',[UserController::class,'uploadUser']);

    $router->get('/chengbao/lst',[ChengBaoController::class,'index']);
    $router->get('/chengbao/del',[ChengBaoController::class,'del']);
    $router->match(['get','post'],'/chengbao/uploadChengBao',[ChengBaoController::class,'uploadChengBao']);
    $router->get('/chengbao/sumIndex',[ChengBaoController::class,'sumIndex']);
    $router->get('/chengbao/exportFile',[ChengBaoController::class,'exportFile']);


    $router->get('/lipei/del',[LiPeiController::class,'del']);
    $router->get('/lipei/lst',[LiPeiController::class,'index']);
    $router->get('/lipei/detail',[LiPeiController::class,'detail']);
    $router->match(['get','post'],'/lipei/uploadLiPei',[LiPeiController::class,'uploadLiPei']);
    $router->match(['get','post'],'/lipei/change',[LiPeiController::class,'change']);
    $router->get('/lipei/sumIndex',[LiPeiController::class,'sumIndex']);
    $router->get('/lipei/exportFile',[LiPeiController::class,'exportFile']);

    $router->get('/chengbao/countPriceIndex',[ChengBaoController::class,'countPriceIndex']);
    $router->get('/chengbao/exportCountPrice',[ChengBaoController::class,'exportCountPrice']);
    $router->get('/chengbao/handleCountPrice',[ChengBaoController::class,'handleCountPrice']);


});
//修理厂
Route::group(['prefix'=>'repair'],function(Router $router){

    $router->get('/factory/index',[RepairFactoryController::class,'index']);
    $router->get('/factory/detail',[RepairFactoryController::class,'detail']);
    $router->get('/factory/del',[RepairFactoryController::class,'del']);
    $router->get('/factory/commentLst',[RepairFactoryController::class,'commentLst']);
    $router->get('/factory/commentDel',[RepairFactoryController::class,'commentDel']);
    $router->match(['get','post'],'/factory/add',[RepairFactoryController::class,'add']);
});
//订单管理
Route::group(['prefix'=>'order'],function(Router $router){

    $router->get('/index',[OrderController::class,'index']);
    $router->get('/secondPass',[OrderController::class,'secondPass']);
    $router->get('/secondNotPass',[OrderController::class,'secondNotPass']);
    $router->get('/repayPass',[OrderController::class,'repayPass']);
    $router->get('/repayNotPass',[OrderController::class,'repayNotPass']);
    $router->get('/repairedNotPass',[OrderController::class,'repairedNotPass']);
    $router->get('/end',[OrderController::class,'end']);
    $router->get('/exportFile',[OrderController::class,'exportFile']);
});






